package com.maiji.cloud.entities.community;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.maiji.cloud.entities.login.UserInfo;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.util.List;

@NoArgsConstructor
@Data
@Accessors(chain=true)
@Table(name = "com_comment")
public class ComComment {

    @TableId
    @Column(name = "comment_id", type = MySqlTypeConstant.VARCHAR, length = 50, isKey = true)
    private String commentId;

    @Column(name = "belong_id", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String belongId;

    @Column(name = "msg_id", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String msgId;

    @Column(name = "source_user_id", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String sourceUserId;

    @Column(name = "target_user_id", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String targetUserId;

    @Column(name = "content", type = MySqlTypeConstant.VARCHAR, length = 1200)
    private String content;

    @Column(name = "publish_time", type = MySqlTypeConstant.BIGINT)
    private Long publishTime;//发布时间戳

    @Column(name = "status",type = MySqlTypeConstant.INT,length = 2)
    private Integer status; //0:评论 1:转发 2:评论的评论 3:回复

    @Column(name = "praise_count" , type = MySqlTypeConstant.INT, length = 4,defaultValue = "0")
    private Integer praise_count;//点赞

    @TableField(exist = false)
    private UserInfo sourceUser; //来源用户信息

    @TableField(exist = false)
    private UserInfo targetUser; //被回复的用户信息

    @TableField(exist = false)
    private List<ComComment> commentList;//评论的评论列表

    @TableField(exist = false)
    private ComPraise praise;//访问用户是否点赞

    @Column(name = "delete",type = MySqlTypeConstant.INT,length = 2,defaultValue = "0")
    private Integer delete; //1：被本人删除、2：被作者删除 、3：被管理员删除

    @Column(name = "delete_reason",type = MySqlTypeConstant.VARCHAR,length = 20)
    private String deleteReason; //删除原因

    @Column(name = "read_already",type = MySqlTypeConstant.INT,length = 2,defaultValue = "0")
    private Integer readAlready; //已读

    @TableField(exist = false)
    private String nickName; //发布者昵称

    @TableField(exist = false)
    private List<ComAtWho> atUserIds; //at列表

}
